// File:    Convenio.cs
// Author:  Lucas Bittencourt
// Created: quarta-feira, 16 de novembro de 2011 18:32:47
// Purpose: Definition of Class Convenio

using System;
using System.Text;

namespace DA_OOMModel
{
   public class Convenio
   {
       private int cvnIdConvenio;
       private string cvnCdCedente;
       private string cvnNuProximoNossoNumero;
       private string cvnCdVariacao;

       private Iesi.Collections.ISet tituloFinanceiro;
      
      /// <summary>
      /// Property for collection of TituloFinanceiro
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet TituloFinanceiro
      {
         get
         {
            return tituloFinanceiro;
         }
         set
         {
            this.tituloFinanceiro = value;         
         }
      }
      private ContaBancaria contaBancaria;
      
      /// <summary>
      /// Property for ContaBancaria
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual ContaBancaria ContaBancaria
      {
         get
         {
            return contaBancaria;
         }
         set
         {
               this.contaBancaria = value;
         }
      }
   
      /// <summary>
      /// Get value of property CvnIdConvenio.
      /// </summary>
      public virtual int CvnIdConvenio
      {
         get
         {
            return cvnIdConvenio;
         }
         set
         {
            if (this.cvnIdConvenio != value)
               this.cvnIdConvenio = value;
         }
      }
      
      /// <summary>
      /// Get value of property CvnCdCedente.
      /// </summary>
      public virtual string CvnCdCedente
      {
         get
         {
            return cvnCdCedente;
         }
         set
         {
            if (this.cvnCdCedente != value)
               this.cvnCdCedente = value;
         }
      }
      
      /// <summary>
      /// Get value of property CvnNuProximoNossoNumero.
      /// </summary>
      public virtual string CvnNuProximoNossoNumero
      {
         get
         {
            return cvnNuProximoNossoNumero;
         }
         set
         {
            if (this.cvnNuProximoNossoNumero != value)
               this.cvnNuProximoNossoNumero = value;
         }
      }
      
      /// <summary>
      /// Get value of property CvnCdVariacao.
      /// </summary>
      public virtual string CvnCdVariacao
      {
         get
         {
            return cvnCdVariacao;
         }
         set
         {
            if (this.cvnCdVariacao != value)
               this.cvnCdVariacao = value;
         }
      }
   
      /// <summary>
      /// Get and set primary key class
      /// </summary>
      public virtual ConvenioPK ConvenioPK
      {
         get 
         {
            return new ConvenioPK(cvnIdConvenio);
         }
         set
         {
            if (value != null)
            {
               this.cvnIdConvenio = value.CvnIdConvenio;
            }
         }
      }
   
      /// <summary>
      /// Get hash code
      /// </summary>
      /// <pdGenerated>Get hash code</pdGenerated>
      public override int GetHashCode()
      {
         int _hashCode = 0;
         _hashCode = 29 * ConvenioPK.GetHashCode();
         if (this.cvnCdCedente != null) 
            _hashCode += 29 * cvnCdCedente.GetHashCode();
      
         if (this.cvnNuProximoNossoNumero != null) 
            _hashCode += 29 * cvnNuProximoNossoNumero.GetHashCode();
      
         if (this.cvnCdVariacao != null) 
            _hashCode += 29 * cvnCdVariacao.GetHashCode();
         return _hashCode;
      }
   
      /// <summary>
      /// Test if two objects are equal
      /// </summary>
      /// <param name="object">Object to compare</param>
      /// <pdGenerated>Test if two objects are equal</pdGenerated>
      public override bool Equals(object obj)
      {
         if (obj == null)
            return false;
         Convenio cast = obj as Convenio;
         if (!(obj is Convenio))
            return false;
         if (!this.ConvenioPK.Equals(cast.ConvenioPK))
            return false;
         if (this.cvnIdConvenio != cast.CvnIdConvenio)
            return false;
         if (String.Equals(this.cvnCdCedente, cast.CvnCdCedente) == false)
            return false;
      
         if (String.Equals(this.cvnNuProximoNossoNumero, cast.CvnNuProximoNossoNumero) == false)
            return false;
      
         if (String.Equals(this.cvnCdVariacao, cast.CvnCdVariacao) == false)
            return false;
      
      
         return true;
      }
   
      /// <summary>
      /// Get object in string format
      /// </summary>
      /// <pdGenerated>Get object in string format</pdGenerated>
      public override string ToString()
      {
         StringBuilder ret = new StringBuilder();
         ret.Append( "Convenio: " );
         ret.Append( "CvnIdConvenio='" + cvnIdConvenio.ToString() + "'");
         if (cvnCdCedente != null)
            ret.Append( "CvnCdCedente='" + cvnCdCedente.ToString() + "'");
         if (cvnNuProximoNossoNumero != null)
            ret.Append( "CvnNuProximoNossoNumero='" + cvnNuProximoNossoNumero.ToString() + "'");
         if (cvnCdVariacao != null)
            ret.Append( "CvnCdVariacao='" + cvnCdVariacao.ToString() + "'");
         return ret.ToString();
      }
   
   }
}